"""
Data adapters package for market data service.

This package provides a unified interface for accessing market data from various sources:
- Core: Base classes, models, and exceptions
- Providers: Concrete implementations for specific data sources
- Manager: Centralized adapter lifecycle management

Example:
    Basic usage with adapter manager:
    
    >>> from app.adapters import AdapterManager
    >>> from app.config import service_config
    >>> 
    >>> manager = AdapterManager(config=service_config)
    >>> await manager.initialize()
    >>> 
    >>> # Use an adapter
    >>> async with manager.adapter_context('tushare') as tushare:
    ...     bars = await tushare.query_bars('000001.SZ', start_date='2024-01-01')
    >>> 
    >>> await manager.cleanup()
"""

# Core classes
from .core import (
    DataAdapter,
    HistoricalDataAdapter,
    RealtimeDataAdapter,
    HybridDataAdapter,
    StreamingDataAdapter,
    Bar,
    Tick,
    Orderbook,
    OrderbookLevel,
    DataFrequency,
    TickDirection,
    MarketType,
    Exchange,
    AdapterError,
    AdapterConnectionError,
    AdapterAuthenticationError,
    AdapterDataError,
    AdapterTimeoutError,
    AdapterRateLimitError,
    AdapterNotFoundError,
    AdapterNotSupportedError,
    AdapterConfigError,
    AdapterSubscriptionError,
)

# Manager
from .manager import AdapterManager, get_manager, set_manager

# Providers (optional - usually accessed via manager)
from .providers import (
    TushareAdapter,
    CTPFuturesAdapter,
    RedFireGatewayAdapter,
    RedFireGatewayManager,
    InfluxDBAsyncAdapter,
)

__all__ = [
    # Core
    'DataAdapter',
    'HistoricalDataAdapter',
    'RealtimeDataAdapter',
    'HybridDataAdapter',
    'StreamingDataAdapter',
    'Bar',
    'Tick',
    'Orderbook',
    'OrderbookLevel',
    'DataFrequency',
    'TickDirection',
    'MarketType',
    'Exchange',
    'AdapterError',
    'AdapterConnectionError',
    'AdapterAuthenticationError',
    'AdapterDataError',
    'AdapterTimeoutError',
    'AdapterRateLimitError',
    'AdapterNotFoundError',
    'AdapterNotSupportedError',
    'AdapterConfigError',
    'AdapterSubscriptionError',
    # Manager
    'AdapterManager',
    'get_manager',
    'set_manager',
    # Providers
    'TushareAdapter',
    'CTPFuturesAdapter',
    'RedFireGatewayAdapter',
    'RedFireGatewayManager',
    'InfluxDBAsyncAdapter',
]

